package com.scm.service;

import com.scm.dao.CategoryMapper;
import com.scm.pojo.Category;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @ClassName CategoryService
 * @Description TODO
 * @Author Xu
 * @Date 2021/7/8 15:25
 * @Version 1.0
 **/
@Service
public class CategoryService implements CategoryMapper {

    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public List<Category> getAllCategory() {
        return categoryMapper.getAllCategory();
    }

    @Override
    public int countAll() {
        return categoryMapper.countAll();
    }

    @Override
    public List<Category> findAllCategory(Map<String, Object> params) {
        return categoryMapper.findAllCategory(params);
    }

    @Override
    public String getCategoryName(String id) {
        return categoryMapper.getCategoryName(id);
    }

    @Override
    public void deleteCategory(String id) {
        categoryMapper.deleteCategory(id);
    }

    @Override
    public Category findCategory(String id) {
        return categoryMapper.findCategory(id);
    }

    @Override
    public void updateCategory(Category category) {
        categoryMapper.updateCategory(category);
    }

    @Override
    public void addCategory(Category category) {
        categoryMapper.addCategory(category);
    }
}
